package com.tongjie.hotelbooking.order.entity;

import com.tongjie.hotelbooking.order.enums.RoomType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "hb_room_info")
public class RoomInfo implements Serializable {

    private static final long serialVersionUID = 272594699692696817L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "order_id")
    private Order order;

    @Column(length = 32)
    private RoomType roomType;

    private Integer roomCount;

}
